/**
 * Created by Administrator on 14-1-6.
 */
(function($) {
    var arkflow = $.arkflow;
    arkflow.PathSmallPointStrategy = arkflow.PathPointStrategy.extend({
        constructor : function(point) {
            this.base("small", point);
        },
        dragable: function() {
            return true;
        },
        createPoint:function() {
            return this.paper.rect(this.point.centerNode.x - this.path.attr.smallDot.width / 2,
                this.point.centerNode.y - this.path.attr.smallDot.height / 2,
                this.path.attr.smallDot.width, this.path.attr.smallDot.height).attr(this.path.attr.smallDot);
        },
        doMoveTo: function(x, y) {
            if (this.point.leftNode && this.point.rightNode && !this.isLine(this.point.leftNode.pos(), {
                x : this.point.centerNode.x,
                y : this.point.centerNode.y
            }, this.point.rightNode.pos())) {
                this.point.bindStrategy("big");
                this.point.rect.attr(this.path.attr.bigDot);
                var P = new arkflow.PathPoint("small",
                    this.center(this.point.leftNode.pos(), this.point.centerNode),
                    this.point.leftNode, this.point.leftNode.right(), this.point.path);
                this.point.leftNode.right(P);
                this.point.leftNode = P;
                var R = new arkflow.PathPoint("small",
                    this.center(this.point.rightNode.pos(), this.point.centerNode),
                    this.point.rightNode.left(), this.point.rightNode, this.point.path);
                this.point.rightNode.left(R);
                this.point.rightNode = R;
            }
        }
    });
})(jQuery);